package nl.windgazer.arachne.services.yql;

import org.apache.tapestry5.json.JSONObject;

public class YQLRSSEntryFactory {

	public static YQLRSSEntry getEntry(JSONObject o) {
		if (isTwitterEntry(o)) {
			return new YQLRSSTwitterEntry(o);
		}
		return new YQLRSSEntryImp(o);
	}

	private static boolean isTwitterEntry(JSONObject o) {
		return o.getString("link").startsWith("http://twitter");
	}
}
